Skip to content

Add shared monitor dispatcher scheduler#107

Merged
Pigbibi merged 1 commit into
mainfrom
feature/monitor-dispatcher-scheduler
Jun 19, 2026
Merged

Add shared monitor dispatcher scheduler#107
Pigbibi merged 1 commit into
mainfrom
feature/monitor-dispatcher-scheduler

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add /monitor-dispatch to fan out due probe and dry-run checks from one shared scheduler
  • keep the formal strategy scheduler on /run only and delete legacy probe/precheck/session-check scheduler jobs
  • preserve HTTP 200 for terminal funding blocks so DCA insufficient funds does not retry, while exceptions still return 500

Tests

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --no-project --with pytest --with requests --with google-auth --with flask --with pandas python -m pytest tests/test_monitor_dispatcher.py tests/test_request_handling.py::test_cloud_run_route_contracts_are_registered tests/test_request_handling.py::test_monitor_dispatch_post_dispatches_due_targets tests/test_request_handling.py::test_run_endpoint_returns_200_for_terminal_funding_block tests/test_sync_cloud_run_env_workflow.py::test_sync_cloud_run_env_workflow_syncs_scheduler_from_runtime_target
  • python3 -m py_compile application/monitor_dispatcher.py main.py

@Pigbibi Pigbibi merged commit 12affb3 into main Jun 19, 2026
1 check passed
@Pigbibi Pigbibi deleted the feature/monitor-dispatcher-scheduler branch June 19, 2026 10:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd010b72bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"strategy_profile": runtime_target.get("strategy_profile"),
"account_scope": runtime_target.get("account_scope"),
"runtime_target_enabled": os.environ.get("RUNTIME_TARGET_ENABLED", "true"),
"scheduler": runtime_target.get("scheduler") if isinstance(runtime_target.get("scheduler"), dict) else {},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Populate dispatcher targets with resolved monitor times

When RUNTIME_TARGET_JSON does not include a scheduler block, this writes MONITOR_DISPATCH_TARGETS_JSON with an empty scheduler even though the workflow still resolves CLOUD_SCHEDULER_PROBE_TIME/CLOUD_SCHEDULER_PRECHECK_TIME or the defaults later and then deletes the legacy probe/precheck jobs. In that common env/default configuration, /monitor-dispatch has no probe_time or precheck_time to match, so the shared scheduler will silently stop invoking /probe and /dry-run; include the same resolved monitor times in this target JSON before removing the old jobs.

Useful? React with 👍 / 👎.

Comment on lines +198 to +200
fields = schedule.split()
if len(fields) != 5:
return False

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Accept the two-field monitor schedule format

The workflow continues to accept two-field schedule values such as the defaults 35 9,15 and 45 9, but the dispatcher rejects anything that is not already a five-field cron expression. If a runtime target carries probe_time or precheck_time in the same two-field format used by the workflow variables, this path always returns false, so those monitor windows are never dispatched after the legacy scheduler jobs are deleted.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant